package domain

import (
	"net/http"
	"time"
)

type Thread struct {
	UUID     string    `json:"uuid" gorm:"primaryKey"`
	Topic    string    `json:"topic" validate:"required"`
	UserID   string    `json:"user_id" validate:"required"`
	CreateAt time.Time `json:"create_at" gorm:"autoCreateTime"`
	UpdateAt time.Time `json:"update_at" gorm:"autoUpdateTime"`
}

type ThreadHandler interface {
	Create(w http.ResponseWriter, r *http.Request)
}

type ThreadService interface {
	InsertThread(thread *Thread) error
}

type ThreadRepository interface {
	CreateThread(thread *Thread) error
	DeleteThread(threadID string) error
	GetThreadByTopic(name string) (Thread, error)
}
